package complexity.cohesion;

import java.util.List;

public class PackageParser {

	public PackageParser(String packageName) {
		this.packageName = packageName;
	}
	  
	public String packageName;
	
	public String getPackageName()
	{
		String[] packageFirstLine = packageName.split(" ");
		if( packageFirstLine[0].equals("package") )
			return packageFirstLine[1];	
		else
			return "";
	}
	
	public void setPackageName(String packageName)
	{
		this.packageName = packageName;
	}
	
	public String getClassNameFromSourceFile()
	{
		return "";
	}
	
	public void parseClass(String className){}
	
	public List<String> getClassMethodsNameList(){
		return null;
	}
	
	public double[] parseClassMethod(String methodName)
	{		
		// calculate McCabeCyclomaticComplexityCalculator
		McCabeCyclomaticComplexityCalculator mcCabeCyclomaticComplexityCalculator = new McCabeCyclomaticComplexityCalculator();
		String methodBody="";
		while(true)
		{
			methodBody = methodBody+"satirin icerigi";
			break;
		}
		double methodMaccabeComplexityResult = mcCabeCyclomaticComplexityCalculator.calculate(methodBody);
		
		CohesionCalculator cohesionCalculator = new CohesionCalculator();
		double methodCohesionResult = cohesionCalculator.calculate(methodBody);
		
		double[] calculationresults = new double[2];
		calculationresults[0] = methodMaccabeComplexityResult;
		calculationresults[1] = methodCohesionResult;
		
		return calculationresults;
		
	}
	
	
	
	
}
